# Bad Snippets I Wrote
I wrote a lot of bad code in my life. This article is a collection of some of the worst snippets that graced my computer screen.
int num_digits(int x) {
return (x < 10 ? 1 :
(x < 100 ? 2 :
(x < 1000 ? 3 :
(x < 10000 ? 4 :
(x < 100000 ? 5 :
(x < 1000000 ? 6 :
(x < 10000000 ? 7 :
(x < 100000000 ? 8 :
(x < 1000000000 ? 9 :
10)))))))));
}
It is so who cares?